package com.matt.service.impl;

import com.matt.foundation.vo.weekPaper.WeekPaperAreaVo;
import com.matt.foundation.vo.weekPaper.WeekPaperTeacherVo;
import com.matt.repository.base.WeekPaperRepository;
import com.matt.service.WeekPaperService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * *******************************
 * Created by lch.
 * form com.matt
 * on $date$
 * *******************************
 */
@Service
@Slf4j
public class WeekPaperServiceImpl implements WeekPaperService {
    @Autowired
    private WeekPaperRepository weekPaperRepository;


    @Override
    public WeekPaperAreaVo getAreaWeekData(String areaId,String date) {
        return weekPaperRepository.getAreaWeekData(areaId,date);
    }

    @Override
    public WeekPaperTeacherVo getTeacherWeekData(String areaId,String staffId,String date) {
        Integer areaIntoChildNum = weekPaperRepository.getAreaIntoChildNum(areaId,date);
        Integer unExamineChildNum = weekPaperRepository.getUnExamineChildNumByStaffId(staffId,date);
        return WeekPaperTeacherVo.of(areaIntoChildNum,unExamineChildNum);
    }

    @Override
    public Integer getExamineNum(String staffId,String date) {
        return weekPaperRepository.getExamineNum(staffId,date);
    }
}
